package com.zjxh.zjxh.common.util;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Collection;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @description: 重写Page方法，用于打印日志信息
 * @author: @Date: 2021/8/13 on 4:02 下午
 */
@ApiModel(value = "分页信息体")
@Data
@Accessors(chain = true)
public class NPage<T> {

  @ApiModelProperty("总条数")
  @JSONField(ordinal = 1)
  private long total;

  @ApiModelProperty("总页数")
  @JSONField(ordinal = 2)
  private long pages;

  @ApiModelProperty("数据")
  @JSONField(ordinal = 3)
  private Collection<T> records;

  @ApiModelProperty("当前分页数")
  @JSONField(ordinal = 4)
  private long size;

  @ApiModelProperty("当前页")
  @JSONField(ordinal = 5)
  private long current;

  // @JSONField(ordinal = 6)
  // private List<OrderItem> orders;
  //
  // @JSONField(ordinal = 7)
  // private boolean optimizeCountSql;
  //
  // @JSONField(ordinal = 8)
  // private boolean isSearchCount;
}
